package io.kiki.sba.registry.server.metadata.slot.balance;


public interface BalancePolicy {

    /**
     * Gets get low water mark slot leader nums. low watermark means the threshold we could endure
     * with, that once the slot leader numbers on a data-server is under the low water mark, we need
     * to rebalance the slot-table
     *
     * @param average the average
     * @return the get low water mark slot leader nums
     */
    int getLowWaterMarkSlotLeaderNums(int average);

    /**
     * Gets get low water mark of follower slot nums. low watermark means the threshold we could
     * endure with, that once the follower slot numbers on a data-server is under the low water mark,
     * we need to rebalance the slot-table
     *
     * @param average the average
     * @return the get low water mark of slot follower nums
     */
    int getLowWaterMarkSlotFollowerNums(int average);

    int getHighWaterMarkSlotLeaderNums(int average);

    int getHighWaterMarkSlotFollowerNums(int average);

    /**
     * Gets get max move leader slots. max move means the maximum number of slots' leader we are good
     * to migrate per balance time
     *
     * @return the get max move leader slots
     */
    int getMaxMoveLeaderSlots();

    /**
     * Gets get max move follower slots. max move means the maximum number of slots' followers we are
     * good to migrate per balance time
     *
     * @return the get max move follower slots
     */
    int getMaxMoveFollowerSlots();
}
